package com.bjqg.bjqg01.bjqg.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.bjqg.bjqg01.bjqg.R;
import com.bjqg.bjqg01.bjqg.adapter.ReportFragmentAdapter;

/**
 * Created by bjqg01 on 2017/12/13.
 */

public class ReportFindActivity extends BaseActivity implements View.OnClickListener {

    private ImageView goback;
    private EditText etSearch;
    private TextView tvSearch;
    private TabLayout tabs;
    private ViewPager vp;
    private String[] mTitles={"工程","厂家"};
    private ReportFragmentAdapter fragmentAdapter;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_report_find);

        initView();
    }

    private void initView() {
        goback = (ImageView) findViewById(R.id.back);
        etSearch = (EditText) findViewById(R.id.id_search);
        tvSearch = (TextView) findViewById(R.id.tv_search);

        tabs = (TabLayout) findViewById(R.id.tab);
        vp = (ViewPager) findViewById(R.id.vp);

        fragmentAdapter = new ReportFragmentAdapter(getSupportFragmentManager(), mTitles);
        vp.setAdapter(fragmentAdapter);

//        tabs.setupWithViewPager(vp);

//        for (int i = 0; i < mTitles.length; i++) {
//            tabs.addTab(tabs.newTab());
//        }

        goback.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.back:
                finish();
                break;
        }
    }
}
